import requests as re
import json

url='https://fanyi.baidu.com/sug'
word=input("请输入您要翻译的单词：")
param={'kw':word}
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'}


resp=re.get(url=url,headers=headers,params=param)
#word_data=resp.text
obj=resp.content.decode('unicode_escape')

json1=eval(obj)
list1=json1.get('data')

print(list1[0].get('v'))

#soup = BeautifulSoup(word_data, 'htmlinparser')
#result = soup.find('div', {'class': 'translate-wrap'})
